1. Field of the Invention
The present invention generally relates to coding methods, decoding methods, coding apparatuses and decoding apparatuses and, more particularly, to a coding method, a decoding method, a coding apparatus and a decoding apparatus for information source coding and decoding using subsampling.
2. Description of the Related Art
Of two-dimensional signals for which the present invention is adapted, a still image signal composed of Y, Cr and Cb components is taken as an example for description of coding/decoding according to the invention. In coding a still image, signals are often processed by subsampling for reduction of data volume, resulting in the sampling frequency being lowered. For example, the number of sampling points for the Cr and Cb signals may be ½ that of the sampling points of the Y signal. Such a method should however be used only for images containing natural scenery or objects since it produces pseudo colors in colored characters and line drawings. For this reason, subsampling should be selected adaptively when an image contains a mixture of natural scenery or objects, characters and computer graphics and the like.
FIG. 10 is a flowchart showing a subsampling process performed by an encoder according to the related disclosed in Japanese Laid-Open Patent Application No. 1-51786.
A description will now be given of the operation according to the related art. FIG. 11 shows an area of a two-dimensional field or frame of a digital image signal to be transmitted. In FIG. 11, pixels of an original image to be coded are indicated by ∘, ●, □, Δ and ×. A horizontal interval between pixels corresponds to a sampling period and a vertical interval corresponds to a line interval.
Referring to the flowchart of FIG. 10, in step ST101, basic pixels of an original image indicated by ∘ are transmitted. In step ST102, a pixel indicated by ● is predicted by determining an average of two basic pixels indicated by ∘ above and below the pixel indicated by ●In step ST103, a comparison is made between the prediction value and the original pixel indicated by ●. If it is determined that a prediction error exceeds a threshold level, control is turned to step ST105. If the prediction error is below the threshold level, control is turned to step ST104. In step ST105, 1 is transmitted as bitmap data and the original pixel indicated by ● is transmitted. In step ST104, the pixel indicated by ● is replaced by the prediction value for pixel-skipping. 0 is transmitted as bitmap data.
In steps ST106 through ST108 and ST109, a prediction value a pixel indicated by □ is determined from two pixels indicated by ∘ and ● to the right and left. A comparison is made between the prediction value and the original pixel data, whereupon the pixel indicated by □ is replaced by the prediction value or the original pixel is transmitted, depending on the result of comparison.
In steps ST110 through ST112 and ST113, a prediction value for a pixel indicated by Δ is determined from two pixels indicated by ∘ and ● to the right and left or two pixels indicated by □. A comparison is made between the prediction value and the original pixel data, whereupon the pixel indicated by A is replaced by the prediction value or the original pixel is transmitted, depending on the result of comparison.
In steps ST114 through ST116 and ST117, a prediction value for a pixel indicated by × is determined from two pixels indicated by ∘ and □ to the right and left, two pixels indicated by Δ to the right and left, or two pixels ● and □ to the right and left. A comparison is made between the prediction value and the original pixel data, whereupon the pixel indicated by × is replaced by the prediction value or the original pixel is transmitted, depending on the result of comparison.
In the related-art coding, of a plurality of pixels temporarily and spatially arranged, regularly arranged basic pixels are coded without being skipped. Pixels other than the basic pixels may be skipped by subsampling or coded using the original data. A determination as to whether a target pixel should be skipped or coded using original data is based on the magnitude of a prediction error occurring when the pixel is subject to interpolation using an average of two pixels above and below or two pixels to the right and left of the target pixel. If the prediction error exceeds a threshold level, the target pixel is coded using the original data. If the prediction error is below the threshold level, the pixel is no coded. The pixel not coded is replaced at a decoding end by an average value.
Thus, the related-art coding apparatus bases its operation on identifying regularly arranged signals and subjecting the other signals to adaptive sampling by determining the magnitude of prediction errors.
Since a determination as to whether subsampling should be performed is based on the magnitude of a prediction error, a relatively large increase in the threshold level for effective subsampling may result in insufficient reconstruction of characters and line drawings containing important information at the edges thereof.
In the related-art coding apparatus, basic pixels are subject to predictive coding. Accordingly, two types of prediction, extrapolation prediction for basic pixels and interpolation prediction for the other pixels, are required, resulting in a disadvantage in that the construction of the apparatus becomes complex and the coding performance cannot be improved beyond a certain level.